<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <body>

        <ui:composition template="./../Template/generalTemplate.xhtml">

            <ui:define name="content">
                <h:form id="form">
                    <p:growl id ="growl" showDetail="true"/>
                    <f:view beforePhase="#{editMPSTableManagedBean.initView}">
                        <p:panel id="editMPSTableA" header="#{editMPSTableManagedBean.title}" style="height:495px;">
                            <p:wizard showStepStatus="false"  widgetVar="wiz" style="height:450px;" flowListener="#{editMPSTableManagedBean.onFlowProcess}">
                                <p:tab title="1" id="a">
                                    <h3>
                                        <h:outputText value="MPS for Classic Nutri Bar-Nuts" />
                                         <p:commandButton value="Update"  update="growl" ajax="false" actionListener="#{editMPSTableManagedBean.updateFormA}" style="margin-left:50px;"/>
                                    </h3>
                                    <p:dataTable id="mpsTableViewA" dynamic="true" emptyMessage="No Item to display" value="#{editMPSTableManagedBean.mpsListA}" var ="mpsListA" paginator="true" rows="10">
                                        <p:column>
                                            <f:facet name="header">Month</f:facet>
                                            #{mpsListA.monthName}
                                        </p:column>
                                        <p:column>
                                            <f:facet name="header">Sales Forecast</f:facet>
                                            #{mpsListA.forecastEntity.amountA}
                                        </p:column>
                                        <p:column>
                                            <f:facet name="header">Production Plan</f:facet>
                                            <p:inplace editor="true" onEditUpdate="mpsTableViewA">
                                                    <p:inputText value="#{mpsListA.monthlyDetailEntity.scheduleA}" />
                                            </p:inplace>
                                        </p:column>
                                        <p:column>
                                            <f:facet name="header">Inventory</f:facet>
                                            #{mpsListA.inventory}
                                        </p:column>
                                        <p:column>
                                            <f:facet name="header">Utilization Rate</f:facet>
                                            #{mpsListA.utilRate}
                                        </p:column>
                                    </p:dataTable>
                                   </p:tab>
                                <p:tab title="2" id="b">
                                    <h3>
                                        <h:outputText value="MPS for Classic Nutri Bar-Fruits" />
                                         <p:commandButton value="Update"  update="growl" ajax="false" actionListener="#{editMPSTableManagedBean.updateFormB}" style="margin-left:50px;"/>
                                    </h3>
                                    <p:dataTable id="mpsTableViewB" dynamic="true" emptyMessage="No Item to display" value="#{editMPSTableManagedBean.mpsListB}" var ="mpsListB" paginator="true" rows="10">
                                        <p:column>
                                            <f:facet name="header">Month</f:facet>
                                            #{mpsListB.monthName}
                                        </p:column>
                                        <p:column>
                                            <f:facet name="header">Sales Forecast</f:facet>
                                            #{mpsListB.forecastEntity.amountB}
                                        </p:column>
                                        <p:column>
                                            <f:facet name="header">Production Plan</f:facet>
                                            <p:inplace editor="true" onEditUpdate="mpsTableViewB">
                                                    <p:inputText value="#{mpsListB.monthlyDetailEntity.scheduleB}" />
                                            </p:inplace>
                                        </p:column>
                                        <p:column>
                                            <f:facet name="header">Inventory</f:facet>
                                            #{mpsListB.inventory}
                                        </p:column>
                                        <p:column>
                                            <f:facet name="header">Utilization Rate</f:facet>
                                            #{mpsListB.utilRate}
                                        </p:column>
                                    </p:dataTable>
                                   
                                </p:tab>
                                <p:tab title="3" id="c">
                                    <h3>
                                        <h:outputText value="MPS for Premium Power Bar-Chocolate Nuts" />
                                         <p:commandButton value="Update"  update="growl" ajax="false" actionListener="#{editMPSTableManagedBean.updateFormC}" style="margin-left:50px;"/>
                                    </h3>
                                    <p:dataTable id="mpsTableViewC" dynamic="true" emptyMessage="No Item to display" value="#{editMPSTableManagedBean.mpsListC}" var ="mpsListC" paginator="true" rows="10">
                                        <p:column>
                                            <f:facet name="header">Month</f:facet>
                                            #{mpsListC.monthName}
                                        </p:column>
                                        <p:column>
                                            <f:facet name="header">Sales Forecast</f:facet>
                                            #{mpsListC.forecastEntity.amountC}
                                        </p:column>
                                        <p:column>
                                            <f:facet name="header">Production Plan</f:facet>
                                            <p:inplace editor="true" onEditUpdate="mpsTableViewC">
                                                    <p:inputText value="#{mpsListC.monthlyDetailEntity.scheduleC}" />
                                            </p:inplace>
                                        </p:column>
                                        <p:column>
                                            <f:facet name="header">Inventory</f:facet>
                                            #{mpsListC.inventory}
                                        </p:column>
                                        <p:column>
                                            <f:facet name="header">Utilization Rate</f:facet>
                                            #{mpsListC.utilRate}
                                        </p:column>
                                    </p:dataTable>
                                   
                                    
                                </p:tab>
                                <p:tab title="4" id="d">
                                    <h3>
                                        <h:outputText value="MPS for Premium Power Bar-Redcurrant Fruits" />
                                        <p:commandButton value="Update"  update="growl" ajax="false" actionListener="#{editMPSTableManagedBean.updateFormD}" style="margin-left:50px;"/>
                                    </h3>
                                    <p:dataTable id="mpsTableViewD" dynamic="true" emptyMessage="No Item to display" value="#{editMPSTableManagedBean.mpsListD}" var ="mpsListD" paginator="true" rows="10">
                                        <p:column>
                                            <f:facet name="header">Month</f:facet>
                                            #{mpsListD.monthName}
                                        </p:column>
                                        <p:column>
                                            <f:facet name="header">Sales Forecast</f:facet>
                                            #{mpsListD.forecastEntity.amountD}
                                        </p:column>
                                        <p:column>
                                            <f:facet name="header">Production Plan</f:facet>
                                            <p:inplace editor="true" onEditUpdate="mpsTableViewD">
                                                    <p:inputText value="#{mpsListD.monthlyDetailEntity.scheduleD}" />
                                            </p:inplace>
                                        </p:column>
                                        <p:column>
                                            <f:facet name="header">Inventory</f:facet>
                                            #{mpsListD.inventory}
                                        </p:column>
                                        <p:column>
                                            <f:facet name="header">Capacity Occupation</f:facet>
                                            #{mpsListD.utilRate}
                                        </p:column>
                                    </p:dataTable>
                                    <p:commandButton value="Save" update="growl statusMessage" ajax="false" actionListener="#{editMPSTableManagedBean.save}" style="margin-top:3px;margin-right:5px;position:relative;float:right"/>
                                </p:tab>
                                
                            </p:wizard>    
                        </p:panel>
                    </f:view>
                </h:form>
            </ui:define>

        </ui:composition>

    </body>
</html>
